package com.example.demo.repository;

import com.example.demo.entity.Grade;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;

public interface GradeRepository extends JpaRepository<Grade, Long> {
    List<Grade> findByStudentId(Long studentId);
    List<Grade> findByCourseId(Long courseId);
    
    @Query("SELECT g FROM Grade g WHERE g.score BETWEEN :minScore AND :maxScore")
    List<Grade> findByScoreRange(Double minScore, Double maxScore);
} 